import { getArticleByIdAPI } from '../../api/article';
import { SAVE_ARTICLES } from './actionType';

export const getArticleAction = (id) => {
  return async (dispatch) => {
    const result = await getArticleByIdAPI(id);
    dispatch({ type: SAVE_ARTICLES, payload: result.data.results });
  };
};
